package com.zhiyu.service;

import com.zhiyu.common.BaseService;
import com.zhiyu.mapper.AdminMapper;
import com.zhiyu.pojo.Admin;
import org.springframework.stereotype.Service;

@Service
public class AdminService extends BaseService<AdminMapper, Admin> {
    public String login(Admin admin){
        if(admin.getAdminName() == null || admin.getAdminPwd() == null){
            return "管理员不存在";
        }
        //校验该用户
        Admin adminCheck = mapper.selectByAdmin(admin);
        if(adminCheck != null){
            String adminStr = adminCheck.getId()+":"+adminCheck.getAdminName();
            return adminStr;
        }else{
            return "管理员不存在";
        }
    }
}